﻿
Imports System.Data
Imports VSModel
Imports Cls_Common

Partial Class Control_ImageAdver_Detail
    Inherits System.Web.UI.UserControl
#Region "Sub and Function "
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            If Not Request.QueryString("Id").ToString.Equals("0") Then
                hidID.Value = Request.QueryString("Id")
                ShowData()
            End If
        End If
    End Sub
    Protected Sub ShowData()
        Using data As New VSEntities
            Dim p As ImagesAdver = (From q In data.ImagesAdvers Where q.ID = hidID.Value Select q).SingleOrDefault
            If Not p Is Nothing Then
                lblTitle.Text = IIf(IsNothing(p.Title) = True, "", p.Title)
                lblDescription.Text = IIf(IsNothing(p.Description) = True, "", p.Description)
                imgSrc.ImageUrl = IIf(IsNothing(p.SRC) = True, "", p.SRC)
                lblUrl.Text = IIf(IsNothing(p.URL) = True, "", p.URL)

                lblCreated.Text = IIf(IsNothing(p.Created) = True, "", p.Created)
                lblCreator.Text = IIf(IsNothing(p.Creator) = True, "", p.Creator)
                lblModified.Text = IIf(IsNothing(p.Modified) = True, "", p.Modified)
                lblModifier.Text = IIf(IsNothing(p.Modifier) = True, "", p.Modifier)
                lblSort.Text = IIf(IsNothing(p.Sort) = True, "", p.Sort)

            End If
        End Using
    End Sub
#End Region
End Class
